package com.iengoo.day03;


import org.junit.Test;

import java.util.Scanner;

/**
 * @author zpym
 * @CopyRight (C) http://www.iengoo.com
 * @brief 变量简单使用
 * @email 122162005@qq.com
 * @date 2019-01-11 15:03
 */
public class VariableDemo {
    public static void main(String[] args) {
        // 创建
        Scanner scanner = new Scanner(System.in);

        System.out.println("请输入数学成绩");
        int mathScore = scanner.nextInt();
//        System.out.println("你输入的数学成绩为：" + mathScore);

        System.out.println("请输入语文成绩");
        int chineseScore = scanner.nextInt();
//        System.out.println("你输入的语文成绩为：" + chineseScore);

        System.out.println("总成绩为：" + (mathScore + chineseScore));
    }


    public void sum(String name, int math, int chinese, int english) {
        int total;  // 定义到方法里面的变量就是局部变量
        total = math + chinese + english;
        System.out.println(name + "的总成绩为：" + total);

    }

    public int total(int math, int chinese, int english) {
        return math + chinese + english;
    }
}
